import {getUserMessage} from "@/api/tool/notice"
const notice ={
	state: {
		message:[],
		mcount:0
	},
	mutations: {
		SET_MESSAGE: (state, message) => {
			state.message = message
		},
		SET_MCOUNT:(state,mcount)=>{
			state.mcount = mcount
		}
	},
	actions: {
		GetNoticeMessage({ commit, state }) {
			return new Promise((resolve, reject) => {
				getUserMessage().then(res => {
				  commit('SET_MESSAGE', res.data.message)
				  commit('SET_MCOUNT',res.data.count)
				  resolve(res)
				}).catch(error => {
				  reject(error)
				})
			  })
		},
	},

}
export default notice
